defmodule Common.ShortenEr do
  @hash_id_length 4

  #require Logger
  #alias Logger, as: LOG


  @doc "Generates a HashId"
  def generate() do
    @hash_id_length
    |> :crypto.strong_rand_bytes()
    |> Base.url_encode64
    |> binary_part(0, @hash_id_length)
    |> String.downcase()
  end

end

